package vip.xiaonuo.bi.modular.datasource.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import vip.xiaonuo.bi.modular.datasource.entity.DatasourceClassify;
import vip.xiaonuo.bi.modular.datasource.mapper.DatasourceClassifyMapper;
import vip.xiaonuo.bi.modular.datasource.param.DatasourceClassifyPageParam;
import vip.xiaonuo.bi.modular.datasource.service.DatasourceClassifyService;

import java.util.List;

/**
 * 数据源分类表Service接口实现类
 *
 * @author 顾育司
 * @date  2023/12/15 12:09
 **/
@Service
public class DatasourceClassifyServiceImpl extends ServiceImpl<DatasourceClassifyMapper, DatasourceClassify> implements DatasourceClassifyService {


    @Override
    public List<DatasourceClassify> getlist(DatasourceClassifyPageParam datasourceClassifyPageParam) {
        QueryWrapper<DatasourceClassify> queryWrapper = new QueryWrapper<>();
        if(ObjectUtil.isNotEmpty(datasourceClassifyPageParam.getClassifyName())) {
            queryWrapper.lambda().like(DatasourceClassify::getClassifyName, datasourceClassifyPageParam.getClassifyName());
        }
        return this.list(queryWrapper);
    }


}